//
// Created by Administrator on 2021/11/26.
//

#include "DonorType.h"

#include "iostream"
#include "iomanip"

using namespace std;

void DonorType::setDonorInfo(
        const string &firstName,
        const string &lastName,
        int membershipNumber,
        double donationAmount) {
    this->setMemberInfo(firstName, lastName, membershipNumber);
    this->donationAmount = donationAmount;
}

void DonorType::setAmountDonated(double donationAmount) {
    this->donationAmount = donationAmount;
}

double DonorType::getAmountDonated() const {
    return donationAmount;
}

void DonorType::printDonor() const {
    this->printMemberInfo();
}

void DonorType::printDonation() const {
    cout <<setiosflags(ios::fixed);
    cout << this->getLastName() << " " << this->getFirstName() << endl
        << "    Donation amount: $" << setprecision(2) << this->donationAmount << endl;
}

bool DonorType::operator<(const DonorType &anotherDonor) const {
    return this->getMembershipNo() < anotherDonor.getMembershipNo();
}
